package com.lagou.controller;

import com.lagou.service.JedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zjy
 * @date: 2020/8/1 1:37 上午
 */
@RestController
public class TestRedisController {

    @Autowired
    JedisService jedisService;

    @RequestMapping("/get")
    public String toLoginPage(@RequestParam("key") String key){
        return jedisService.get(key);
    }

    @RequestMapping("/set")
    public String toLoginPage(@RequestParam("key") String key,@RequestParam("value") String value){
        return jedisService.set(key,value,0);
    }
}
